import java.util.List;

public class OverlapRec836 {
    public static boolean isRectangleOverlap(int[] rec1, int[] rec2) {
        int x1 = Math.max(rec1[0], rec2[0]);
        int x2 = Math.min(rec1[2], rec2[2]);
        int y1 = Math.max(rec1[1], rec2[1]);
        int y2 = Math.min(rec1[3], rec2[3]);

        return (x1 < x2) && (y1 < y2);
    }

    public static void main(String[] args) {
        int[] a = {5, 15, 8, 18};
        int[] b = {0, 3, 7, 9};
        System.out.println(isRectangleOverlap(a, b));
    }
}


